package com.jh.rq;

import java.util.ArrayList;
import java.util.stream.Stream;

/**
 * @author Li
 * @Date 2023/4/20 17:22
 */
public class StreamPractice {
    public static void main(String[] args) {
        ArrayList<String> manList = new ArrayList<>();
        manList.add("刘德华");
        manList.add("黄渤");
        manList.add("古天乐");
        manList.add("邓超");
        manList.add("黄忠泽");
        manList.add("吴京");

        ArrayList<String> womanList = new ArrayList<>();
        womanList.add("刘亦菲");
        womanList.add("周敏");
        womanList.add("杨幂");
        womanList.add("刘诗诗");
        womanList.add("杨紫");
        womanList.add("佟丽娜");
        Stream<String> stream1 = manList.stream().filter(name->name.length()==3);
        Stream<String> stream2 = womanList.stream().filter(name->name.startsWith("杨")).skip(1);
        Stream<String> concat = Stream.concat(stream1,stream2);
       concat.forEach(name->{
           Actor actor = new Actor(name);
           System.out.println(actor);
       });
    }
}
